package com.github.chain.admin.server.dao;

import com.github.chain.admin.common.domain.Role;
import com.github.chain.admin.common.domain.RoleMenu;
import com.github.chain.admin.common.domain.User;
import com.github.framework.core.Result;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

public interface RoleDao {

    /**
     * 根据角色id集合查询对应的具体角色数据
     * @param roleIds
     * @return
     */
    List<Role> findRoleByRoleIds(@Param("roleIds") List<Long> roleIds);

    long findRoleCountByPage(Map<String, Object> map);

    List<Role> findRoleListByPage(Map<String, Object> map);

    Role findRoleById(Long id);

    Integer updateSelective(Role updateRole);

    Integer deleteRoleById(Long id);

    Integer deleteRoleListById(@Param("ids") List<Long> ids);

    Integer insertSelective(Role role);

    Integer authPermissions(RoleMenu roleMenu);

    Integer deleteAuthPermissionsByRoleIdAndMenuIds(RoleMenu roleMenu);

    Integer updateRoleStatusByRoleIds(@Param("ids") List<Long> ids, @Param("status") Integer status);

}
